package edu.pku.sei.modeler.model.structure;

import org.w3c.dom.Element;

import edu.pku.sei.modeler.model.core.MetaElement;
import edu.pku.sei.modeler.model.xml.XMLUtility;

public class MgrElement extends MetaElement{
	private MetaNode m_key;
	private AbstractLocator m_locator;
	
	public MgrElement(){
		m_key = null;
		m_locator = null;
		
	}
	public MgrElement(MetaNode key,AbstractLocator locator){
		m_key = key;
		m_locator = locator;
	}
	public MetaNode getKey(){
		return m_key;
	}
	public void setKey(MetaNode key){
		m_key = key;
	}
	public AbstractLocator getLocator(){
		return m_locator;
	}
	public void setLocator(AbstractLocator locator){
		m_locator = locator;
	}
	 public void serialize(Element root) {
			super.serialize(root);
			XMLUtility.xmlInstance.serializeNodeNotContain(root, StructurePackage.LOCATIONMANAGER_KEY, m_key);
		}

		public void deSerialize(Element root) {
			super.deSerialize(root);
			m_key = (MetaNode)XMLUtility.xmlInstance.deSerializeNodeNotContain(root, StructurePackage.LOCATIONMANAGER_KEY, this);
		}

		public void dynamicSet(String featureID, Object value) {
			if(featureID.equals(StructurePackage.LOCATIONMANAGER_KEY)) {
				m_key = (MetaNode)value;
			}
			else {
				super.dynamicSet(featureID, value);
			}
		}

}

